<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=\, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function ojld(x , y){
        var a;
        if(x < y){
            a = y;
            y = x;
            x = a;
        }
        /* while(y != 0){
            a = y;
            y = x % y;
            x = a;
        }
        return x; */

        var b =  x % y;
        if(b == 0){
            return y;
        }
        return ojld( x, b)
    }
    document.write(ojld(1999 , 57));
</script>
</html>